package top.infopub.mgr.mkt.service;

import com.github.pagehelper.Page;
import top.infopub.dto.mkt.InquiryProDto;
import top.infopub.generic.GenericService;
import top.infopub.mgr.common.vo.RspVo;
import top.infopub.mgr.mkt.domain.BidCurrencyDomain;
import top.infopub.mgr.mkt.domain.InquiryProDomain;
import top.infopub.mgr.mkt.jsonvo.InquiryProJsonVo;
import top.infopub.mgr.mkt.vo.InquiryProVo;
import top.infopub.model.mkt.*;
import top.infopub.model.om.PaymentApply;
import top.infopub.model.om.PaymentApplyDetail;
import top.infopub.security.vo.AuthorizationVO;

import java.util.List;

public interface InquiryProService extends GenericService<InquiryPro, String> {

    /**
     * 根据条件查询资格预审记录
     * @param page
     * @param inquiryProVo
     * @return
     * @see
     */
    Page<BidCurrencyDomain> selectPageByDomainWhere(Page<BidCurrencyDomain> page,
                                                    InquiryProVo inquiryProVo);

    /*根据proCode查出projectInfo的所有信息*/
    ProjectInfo findByProCode(String proCode);


    /**
     * 根据条件查询-我审批的资格预审记录
     * @param page
     * @param inquiryProVo
     * @return
     * @see
     */
    Page<InquiryProDomain> selectMyCheckByDomainWhere(Page<InquiryProDomain> page,
                                                      InquiryProVo inquiryProVo);

    /**
     * 根据id查询资格预审记录
     * @param id 资格审批id
     * @return
     * @see
     */
    InquiryProVo selectById(String id);

    /**
     * 新增资格预审记录
     * @param inquiryPro
     * @param inquiryProCoops
     * @param inquiryProSubs
     * @param fileAtts
     * @see
     */
    void addInquiryPro(InquiryProVo inquiryPro, List<InquiryProCoop> inquiryProCoops,
                       List<InquiryProSub> inquiryProSubs, List<InquiryProAtt> fileAtts);


    void editInquiryPro(InquiryProVo inquiryPro,  List<InquiryProAtt> fileAtts,String submitType);

    /**
     * 查询可决策的资格预审记录
     * @return
     * @see
     */
    List<InquiryPro> selectUsableInquiryPro();

    /**
     * 根据项目编号查询是否已存在（processStatus in ('1','9')）
     * @param proCode 项目编号
     * @return
     * @see
     */
    List<InquiryPro> selectByProCode(String proCode);

    //void saveAll(PaymentApply paymentApply, , List<ProjectAttachment> attachmentList);

    /**
     * 根据id查询详情
     * @param id
     * @return
     */
    InquiryProJsonVo queryDetailById(String id);

    /**
     * 编辑详情
     * @param proInfo
     * @param bidInfo
     * @param paymentApply
     * @param paymentApplyDetail
     * @param attachmentList
     * @param vo
     * @param submitType
     * @return
     */
    RspVo editDetail(InquiryPro inquiryPro, InquiryProDto inqProDto, ProjectInfo proInfo, BidInfo bidInfo, PaymentApply paymentApply, PaymentApplyDetail paymentApplyDetail, String[] companyArr, List<ProjectAttachment> attachmentList, AuthorizationVO vo, Integer submitType);
}
